package com.zl.customer.pojo;

import java.util.List;

/**
 * 分页实体类
 * @ClassName: Page
 * @author: suke
 * @since: 2021/7/14 14:09
 */
public class Page<T>{
    private List<T> datas; //当前页记录
    private int pageIndex;//当前页
    private int pageSize; //页容量
    private long count;//总记录数
    private long totalPages;//总页数

    public List<T> getDatas() {
        return datas;
    }

    public void setDatas(List<T> datas) {
        this.datas = datas;
    }

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    public long getTotalPages() {
        return  this.count % this.pageSize == 0
                 ? this.count / this.pageSize : this.count / this.pageSize+1;
    }
}
